<template>
	<view class="page">
		<view class="tdxqWrap">
			<view class="tdxqTop">
				<u--image custom-style="margin:60rpx auto 40rpx auto;" :showLoading="true" :src="tdContent.imgPrimary" width="160rpx" height="160rpx" shape="circle" />		
				<u--text :text="tdContent.deptName" align="center" color="#404040" size="36rpx" margin="0 0 72rpx 0"/>
			</view>
			<view class="tdxqbottom">
			<u--text text="团队简介" align="center" color="#404040" size="32rpx" margin="40rpx auto"/>
			<view class="tdTable">
				<view class="tdTip">负责人：</view>
				<view class="tdCon">{{tdContent.leaderUser.trueName}}</view>
			</view>
			<view class="tdTable">
				<view class="tdTip">成立时间：</view>
				<view class="tdCon">{{$u.timeFormat(tdContent.createTime, 'yyyy年mm月dd日')}}</view>
			</view>
			<view class="tdTable">
				<view class="tdTip">团队地址：</view>
				<view class="tdCon">{{tdContent.userName}}</view>
			</view>
			<view class="tdTable" style="display: block;">
				<view class="tdTip">简介说明：</view>
				<view class="tdCon" style="padding-top:15rpx;text-indent:60rpx;">
				<u-parse :content="tdContent.intro"
				:tagStyle="{p:'font-size:15px;line-height:30px;text-indent:28px;',img:'display:block;width:100%;margin:0 auto'}"></u-parse>
				</view>
			</view>
			</view>
		</view>
		<view class="tdcy-wrap">
			<!-- <mescroll-body @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback" @up="upCallback"> -->
				<tdcyList :dataList="dataList"/>
			<!-- </mescroll-body> -->
		</view>
		
		<view class="bottom-add" v-if="wdtd=='false'">
			<view style="color:#fff;font-size: 32rpx;">
				成员人数：{{subUserNum}}
			</view>
			<view v-if="isMyzzId=='false'&&(shStatus==5||shStatus==null)">
			<u--image @click="addTd"
			:showLoading="true" :src="require('@/static/images/tdList/xq-add.png')" width="174rpx" height="76rpx" />	
			</view>
			<view v-if="isMyzzId=='true'&&shStatus!=5" style="color:#fff"> 
			{{shStatus==0?'待审核':shStatus==1?'审核通过':shStatus==2?'审核失败':''}}
			
			</view>
		</view>
	</view>
</template>

<script>
	import {mapActions,mapState} from 'vuex'
	//import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
	export default {
		//mixins: [MescrollMixin], // 使用mixin
		options: {styleIsolation: 'shared'},
		data() {
			return {
				tdContent:'',
				myDeptId:null,
				dataList: [],
				isMyzzId:false,
				shStatus:'',
				subUserNum:0,
				wdtd:false,
				/**分页参数
				dataList: [],//团队分页数据
				downOption:{
					auto:false // 不自动加载 (mixin已处理第一个tab触发downCallback)
				},
				upOption:{
					auto:false, // 不自动加载
					page: {
						num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
						size: 10 // 每页数据的数量
					},
					noMoreSize: 3, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
					empty:{
						tip: '~ 空空如也 ~', // 提示
						btnText: '去看看'
					}
				},
				****/
			}
		},
		onLoad(params) {
			this.isMyzzId=params.isMyzzId
			this.shStatus=params.shStatus
			this.myDeptId=params.deptId
			this.subUserNum=params.subUserNum
			this.wdtd=params.wdtd
			//组织详情
			this.getzzContentAction({deptId:this.myDeptId,success:res=>{
				this.tdContent=res.data.data
			}})
			
			
			//this.mescroll.resetUpScroll()
			
		},
		methods: {
			...mapActions('m_zzjg',['getzzContentAction','getcyListAction','hyaddDeptAction']),
			addTd(){
				
				//加入团队
				this.hyaddDeptAction({deptId:this.myDeptId,success:res=>{
					this.isMyzzId='true'
					this.shStatus=0
				}})
				
			},
			/*分页上拉加载下拉刷新
			/*下拉刷新的回调
			downCallback() {
				this.dataList=[]
				this.mescroll.resetUpScroll()
			},
			
			//组织成员列表
			
			
			/*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 
			upCallback(page) {
				const params={
					pageSize:page.size,
					pageNum:page.num,
					deptId:this.myDeptId,
				}
				console.log(params)
				this.getcyListAction({data:params,success:res=>{
					console.log(res)
					let list=res.data.data
					this.total=res.data.total
					if(page.num == 1) this.indexList=[]
					this.dataList=this.dataList.concat(list)
					this.mescroll.endBySize(list.length, res.data.total)
				}})
				
				
			}  */
			
		}
	}
</script>

<style scoped lang="scss">
	.page{box-sizing:border-box;width: 100%;height: 100%;background-color: #f2f5fa;overflow: hidden;padding-bottom: 150rpx;
	background-image: url('../../static/images/tdList/xqTopBg.png');background-repeat: no-repeat;background-size: 750rpx 500rpx;
	background-position: 50% 0%;
	}
	.tdxqWrap{margin:30rpx;}
	.tdxqbottom{background-color: #fff;overflow: hidden;border-radius: 11px;}
	.tdTable{display: flex;align-items: center;margin-bottom:30rpx;padding:0 34rpx;
		.tdTip{font-size:32rpx;color:#000}
		.tdCon{font-size:30rpx;color:#666;text-align: justify;line-height: 60rpx;}
	}
	.bottom-add{display: flex;justify-content: space-between;align-items: center;
		width:100%;box-sizing:border-box;left:50%;transform: translateX(-50%); position: fixed;bottom:0;border-radius: 11px;background:#434a54;padding:40rpx 70rpx;}
	
	
</style>